﻿using B.S.DataBase.MyProject.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using T.E.ERP.Write.API.Applicantions.Command.SaleOrderInfoCommand;

namespace T.E.ERP.Write.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SaleOrderController : ControllerBase
    {
        private readonly IMediator mediator;

        public SaleOrderController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 添加销售订单并且物料信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<object>> AddSaleOrder(AddSaleOrderInfoCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
